home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
moref241.zip
/
MORE.DOC
< prev
next >
Wrap
Text File
|
1990-03-27
|
28KB
|
661 lines
MORE
A Unix-like file browser
by
Fred C. Smith
HISTORY
In late 1984 Dr. Dobbs Journal published Allen Holub's
version of GREP. I ported Mr. Holub's version of GREP to run
on the micro-based workstation that was the environment in
which I was currently working, and quickly found it to be
indispensable.
That, of course, just whetted my appetite for more useful
programs. I was particularly interested in having a program
like Unix's MORE, which is sort of a super file browser. The
workstation I was using had a tool called TYPE (aren't they
all?), which while much better than nothing, just wasn't as
good as MORE. It did nothing more than display on the
terminal one screenfull at a time of text.
I kept waiting, hoping in vain that Dr. Dobbs would
publish a follow-up article after GREP, giving me a version
of MORE. Before too long, however, anticipation got the
better of me and I decided to write my own.
DESCRIPTION
Although my version of more has been ported to several
different environments, this document describes only the
version for MS-DOS/PC-DOS.
More is a file browser with a number of interesting and
useful features. Besides simply displaying a file a
screenfull at a time, MORE allows scrolling in half
screenfulls, and a line at a time. It will display an entire
list of files, one at a time, and can skip forward to the
next file on the list (without completing the current file,
if you choose), jump back to the beginning of the current
file, the beginning of the previous file, skip a specified
number of screenfulls of the current file, search through
each file in the list for a specified text string.
The version of MORE given here is not an exact functional
copy of the Unix version. There are a couple of reasons for
that. First, there is more than one version of MORE on Unix,
depending on which flavor of Unix you have. Second, I did
not have access to a Unix manual or a Unix system for
reference at the time I was writing this program. As a
consequence I first put in those features that I had found
most useful in the past, then added any others that I could
remember. However, most of the features found in Unix
versions of more are here, as well as a few not found on
Unix.
MORE.DOC (V 2.4.1) PAGE 1
As in the Unix versions of MORE, this version will search
for a line containing a match for a specified regular
expression (for details on regular expressions, see Figure
1). This allows searching for sequences of text that match
some specified pattern, rather than a particular character
sequence.
A variance from the Unix `standard' version of MORE (that
relates to searching) is that in the Unix versions that I
have used, when using the 'n' command to repeat the previous
search, the search begins at the first line off the bottom
of the screen. In this version, the search begins at the
line immediately following the line which contained the
preceding match, assuming that no other operations have
occurred since the search. Otherwise, the search begins at
the first line off the bottom of the screen.
This version of MORE has another interesting feature not
seen on most Unix versions, and that is the ability to move
backwards through a file a screenfull at a time.
As in the Unix versions, this version pauses at the end
of each window with a prompt like:
--More--(79%)
The percentage given is the percentage of the current
input file that has so far been read. If displaying input
from a pipe, the percentage figure is not displayed.
This version also contains a help facility. The command
"h", "H" or "?" causes MORE to print a terse help message on
the screen, and then return to the prompt.
Table 1 describes the command line options available in
MORE. Table 2 gives a detailed explanation of each of the
commands that are accepted by MORE when it is paused at the
prompt.
COPYRIGHT INFORMATION
The regular expression parser in this program is
excerpted with only minor changes from the GREP distributed
by DECUS (DEC Users Society). The DECUS code is copyrighted
by DECUS and may be freely distributed for noncommercial
purposes only. Some of the low-level routines which access
the video BIOS are derived from code published in Dr. Dobbs
Journal by Allen Holub and Jeff Duntemann. The code which
tests the executable file for corruption (possibly by a
virus) is derived from code presented in the August 1989 PC
Magazine "Languages" column. The remainder of the code which
constitutes this program, as well as the program itself (and
this documentation), is copyrighted (C) 1986, 1987, 1988,
1989 by Fred C. Smith. The source is not available, but the
executable may be freely distributed as long as it is not in
any way modified and no fee is charged either for the
program or in connection with its distribution. In plain
English, I intend for anyone who wants to use my program to
be able to do so, and I will permit no one to charge any fee
whatsoever for using or distributing it. My copyright
MORE.DOC (V 2.4.1) PAGE 2
banner, and all other messages (including this document)
must remain as I have made them, without change.
You may distribute more freely (within the constraints
outlined in the preceding paragraph), but when you
distribute it you MUST distribute all the files in the
original package. Those files are: more.doc (this file),
more.exe, more.cnf, and any readme files which may be in a
particular release. All files must remain unmodified. You
may, of course, modify more.cnf for your own use, but when
re-distributing more, please use only the original
unmodified files.
IMPLEMENTATION
This version of more is a new implementation, independent
of any versions offered on any variety of Unix system (or,
for that matter, any other offering). There is no source
code in common between this and the Unix versions. The only
commonality is the name and most of the functionality.
USAGE
more [switches] [file names]
See Table 1 for description of the switches. One or more
filenames may be given, and DOS wildcards may be used. If no
files are specified, more will look to standard input for
data to display. This allows more